<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增租户管理')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <input name="projects" id="projects" type="hidden" th:value="${projects}">
        <form class="form-horizontal m" id="form-tenant-add">
			
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">序号：</label>
                <div class="col-sm-8">
                    <input name="serialNumber" class="form-control" type="text" required>
                </div>
            </div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">项目名称：</label>
			    <div class="col-sm-8">
			        <input name="tenantProject" class="form-control" type="text" required>
			    </div>
			</div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">租户楼层：</label>
			    <div class="col-sm-8">
			        <input name="tenantFloor" class="form-control" type="text" required>
			    </div>
			</div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">租户房间：</label>
			    <div class="col-sm-8">
			        <input name="tenantRoom" class="form-control" type="text" required>
			    </div>
			</div>
			
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">租户名称或单位：</label>
                <div class="col-sm-8">
                    <input name="tenantName" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">租户面积(平方米)：</label>
                <div class="col-sm-8">
                    <input name="tenantArea" class="form-control" type="text" required>
                </div>
            </div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">租赁单价(元)：</label>
			    <div class="col-sm-8">
			        <input name="tenantPrice" class="form-control" type="text" required>
			    </div>
			</div>
			
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">空关面积(平方米)：</label>
                <div class="col-sm-8">
                    <input name="emptyArea" class="form-control" type="text" required>
                </div>
            </div>
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">空关单价(元)：</label>
			    <div class="col-sm-8">
			        <input name="emptyPrice" class="form-control" type="text" required>
			    </div>
			</div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">总金额：</label>
                <div class="col-sm-8">
                    <input name="totalPrice" class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">租赁开始时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="tenantTime" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">租赁到期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="tenantEndTime" class="form-control" placeholder="请填写日期" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">租赁期限：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="tenantTerm" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">
                <label class="col-sm-3 control-label is-required">收费：</label>
                <div class="col-sm-8">
                    <div class="check-box" id="chooseCharge">
                        <input type="checkbox" onclick="allcheck()" id="allCheck"  /> 全部选中<br />
                        <label class="check-box"> <input type="checkbox"  name="charges" value="0" /> 物管费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="1" /> 水费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="2" /> 照明费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="3" /> 动力费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="4" /> 公用电费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="5" /> 空调电费 </label>
                        <label class="check-box"> <input type="checkbox"  name="charges" value="6" /> 空调油费 </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">电表：</label>
                <div class="col-sm-8">
                    <div class="check-box" id="chooseAmmeter">
                        <label class="check-box"> <input type="checkbox"  name="ammeter" value="0" /> A表 </label>
                        <label class="check-box"> <input type="checkbox"  name="ammeter" value="1" /> B表 </label>
                        <label class="check-box"> <input type="checkbox"  name="ammeter" value="2" /> C表 </label>
                        <label class="check-box"> <input type="checkbox"  name="ammeter" value="3" /> D表 </label>
                    </div>
                </div>
            </div> -->
			
			<div class="form-group">
			    <label class="col-sm-3 control-label is-required">付款方式：</label>
			    <div class="col-sm-8">
			        <input name="chargesType" class="form-control" type="text" required>
			    </div>
			</div>
			
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <label class="radio-box"> <input type="radio"  name="tenantStatus" value="0" checked/> 正常 </label>
                        <label class="radio-box"> <input type="radio"  name="tenantStatus" value="1" /> 退租 </label>
                        <label class="radio-box"> <input type="radio"  name="tenantStatus" value="2" /> 到期 </label>
                        <label class="radio-box"> <input type="radio"  name="tenantStatus" value="3" /> 空关 </label>
                    </div>
                </div>
            </div>


<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">删除标志：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="delFlag" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "guomao/tenantManagement"

        $(function(){
            initChoice();
        })

        function initChoice(){
            $("#chooseCharge input").each(function(){
               $(this).parent().addClass("checked")
               $(this).attr("checked",true)
            });
        }


    $("#form-tenant-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-tenant-add').serialize());
            }
        }

        $("input[name='tenantTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='tenantEndTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>